﻿Partial Public Class editor
    Protected Sub OnIgnore(ByVal sender As Object, ByVal e As ExecutedRoutedEventArgs)
        MsgBox("Build This Stub ")
    End Sub


    Private _comic As comic

    Private Sub OpenCommand_Executed(ByVal sender As System.Object, ByVal e As System.Windows.Input.ExecutedRoutedEventArgs)
        Me.Cursor = Cursors.Wait
        Dim f As New Windows.Forms.OpenFileDialog
        f.Multiselect = False
        f.Filter = "All Files (*.*)|*.*|Comic Book Archives (*.cbr, *.cbz, *.cb7, *.rar, *.zip)|*.cbr;*.cbz;*.cb7;*.rar;*.zip|Graphic Novel Archives (*.gnr, *.gnz)|*.gnr;*.gnz"
        f.FilterIndex = 1
        Dim dlg As Windows.Forms.DialogResult = f.ShowDialog
        If dlg = Forms.DialogResult.OK Then
            Dim ext As String = IO.Path.GetExtension(f.FileName)
           

            If ext.Contains("gn") Then
                ' TODO build this 
                OnIgnore(sender, e)
            Else
                _comic = New comic(f.FileName)
                Me.comicEditor.Visibility = Windows.Visibility.Visible
                Me.comicEditor.DataContext = _comic

            End If


        End If ' dlg = Forms.DialogResult.OK 
        Me.Cursor = Cursors.Arrow
        ' Debug.WriteLine("Pages: " & _comic.ComicPages.Count)
        Me.DataContext = Me

    End Sub

    Private Sub SaveApplicationCommand_Executed(ByVal sender As System.Object, ByVal e As System.Windows.Input.ExecutedRoutedEventArgs)

    End Sub
End Class
